/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gov.cemaden.library.model.smp;

import br.gov.cemaden.library.model.BaseEntity;
import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.codehaus.jackson.annotate.JsonBackReference;

/**
 *
 * @author paulo.dias
 */
@Entity
@Table(name = "smp_memoria_aplic", schema = "smp")
@SequenceGenerator(name = "sequence", sequenceName = "smp.smp_memoria_aplic_sequence", schema = "smp")
@NamedQueries({
    @NamedQuery(name = "MemoriaAplic.findAll", query = "SELECT a FROM MemoriaAplic a ORDER BY a.id ASC"),
    @NamedQuery(name = "MemoriaAplic.findById", query = "SELECT a FROM MemoriaAplic a WHERE a.id = :id"),
    @NamedQuery(name = "MemoriaAplic.findByHeapInit", query = "SELECT a FROM MemoriaAplic a WHERE a.heapInit = :heapInit"),
    @NamedQuery(name = "MemoriaAplic.findByHeapUsed", query = "SELECT a FROM MemoriaAplic a WHERE a.heapUsed = :heapUsed"),
    @NamedQuery(name = "MemoriaAplic.findByHeapCommitted", query = "SELECT a FROM MemoriaAplic a WHERE a.heapCommitted = :heapCommitted"),
    @NamedQuery(name = "MemoriaAplic.findByHeapMax", query = "SELECT a FROM MemoriaAplic a WHERE a.heapMax = :heapMax"),
    @NamedQuery(name = "MemoriaAplic.findByPermGenInit", query = "SELECT a FROM MemoriaAplic a WHERE a.permGenInit = :permGenInit"),
    @NamedQuery(name = "MemoriaAplic.findByPermGenUsed", query = "SELECT a FROM MemoriaAplic a WHERE a.permGenUsed = :permGenUsed"),
    @NamedQuery(name = "MemoriaAplic.findByPermGenCommitted", query = "SELECT a FROM MemoriaAplic a WHERE a.permGenCommitted = :permGenCommitted"),
    @NamedQuery(name = "MemoriaAplic.findByPermGenMax", query = "SELECT a FROM MemoriaAplic a WHERE a.permGenMax = :permGenMax"),
    @NamedQuery(name = "MemoriaAplic.findByExecAplic;", query = "SELECT a FROM MemoriaAplic a WHERE a.execAplic = :execAplic"),})
public class MemoriaAplic implements Serializable, BaseEntity {

    @Id
    @GeneratedValue(generator = "sequence", strategy = GenerationType.AUTO)
    @Column(name = "id_memoria_aplic", nullable = false, unique = true)
    private Long id;

    @Column(name = "heap_init")
    private Double heapInit;

    @Column(name = "heap_used")
    private Double heapUsed;

    @Column(name = "heap_committed")
    private Double heapCommitted;

    @Column(name = "heap_max")
    private Double heapMax;

    @Column(name = "perm_gen_init")
    private Double permGenInit;

    @Column(name = "perm_gen_used")
    private Double permGenUsed;

    @Column(name = "perm_gen_committed")
    private Double permGenCommitted;

    @Column(name = "perm_gen_max")
    private Double permGenMax;

    @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    @JsonBackReference
    @JoinColumn(name = "id_exec_aplic", referencedColumnName = "id_exec_aplic", unique = true)
    private ExecAplic execAplic;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Double getHeapInit() {
        return heapInit;
    }

    public void setHeapInit(Double heapInit) {
        this.heapInit = heapInit;
    }

    public Double getHeapUsed() {
        return heapUsed;
    }

    public void setHeapUsed(Double heapUsed) {
        this.heapUsed = heapUsed;
    }

    public Double getHeapCommitted() {
        return heapCommitted;
    }

    public void setHeapCommitted(Double heapCommitted) {
        this.heapCommitted = heapCommitted;
    }

    public Double getHeapMax() {
        return heapMax;
    }

    public void setHeapMax(Double heapMax) {
        this.heapMax = heapMax;
    }

    public ExecAplic getExecAplic() {
        return execAplic;
    }

    public void setExecAplic(ExecAplic execAplic) {
        this.execAplic = execAplic;
    }

    public Double getPermGenInit() {
        return permGenInit;
    }

    public void setPermGenInit(Double permGenInit) {
        this.permGenInit = permGenInit;
    }

    public Double getPermGenUsed() {
        return permGenUsed;
    }

    public void setPermGenUsed(Double permGenUsed) {
        this.permGenUsed = permGenUsed;
    }

    public Double getPermGenCommitted() {
        return permGenCommitted;
    }

    public void setPermGenCommitted(Double permGenCommitted) {
        this.permGenCommitted = permGenCommitted;
    }

    public Double getPermGenMax() {
        return permGenMax;
    }

    public void setPermGenMax(Double permGenMax) {
        this.permGenMax = permGenMax;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 31 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final MemoriaAplic other = (MemoriaAplic) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "MemoriaAplic{" + "id=" + id + ", heapInit=" + heapInit + ", heapUsed=" + heapUsed + ", heapCommitted=" + heapCommitted + ", heapMax=" + heapMax + ", permGenInit=" + permGenInit + ", permGenUsed=" + permGenUsed + ", permGenCommitted=" + permGenCommitted + ", permGenMax=" + permGenMax + ", execAplic=" + execAplic + '}';
    }
}
